#!/bin/bash


export GOROOT=/opt/midware/go
export GO111MODULE=on
export PATH=/opt/midware/go/bin:$PATH
#go mod tidy
#go mod vendor

mkdir -p bin

# build time
sed -i "s/buildTimestamp =.*/buildTimestamp = \"`date +"%Y%m%d_%H%M%S"`\"/g" ./pkg/version/version.go


# x86
go build -mod vendor -o bin/highgo_exporter ./cmd/highgo_exporter/main.go 
ls bin/highgo_exporter 
./bin/highgo_exporter --version

# arm
#export GOARCH=arm64
#go build -mod vendor -o bin/highgo_exporter ./cmd/highgo_exporter/main.go
#ls bin/highgo_exporter
#./bin/highgo_exporter --version
